package cn.weiyang.stack;

import java.util.concurrent.SynchronousQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

public class DivTask implements Runnable{
	int a,b;
	public DivTask(int a,int b) {
		this.a=a;
		this.b=b;
	}

	@Override
	public void run() {
		System.out.println(a/b);
		
	}
	
	public static void main(String[] args) {
		//ThreadPoolExecutor pools = new ThreadPoolExecutor(0, Integer.MAX_VALUE, 0L, TimeUnit.SECONDS, new SynchronousQueue<Runnable>());
	    TraceThreadPoolExecutor pools = new TraceThreadPoolExecutor(0, Integer.MAX_VALUE, 0L, TimeUnit.SECONDS, new SynchronousQueue<Runnable>());
		for(int i=0;i<5;i++) {
	    	//pools.submit(new DivTask(200, i));
	    	pools.execute(new DivTask(200, i));
	    }
	}

}
